//
//  FDUserInfoCell.m
//  FamousDoctorOnline
//
//  Created by wszyxc on 16/7/9.
//  Copyright © 2016年 wszyxc. All rights reserved.
//

#import "FDUserInfoCell.h"


@interface FDUserInfoCell ()




@end


#define kMargin 10


@implementation FDUserInfoCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
     
    }
    return self;
}



- (void)layoutSubviews{
    
    [super layoutSubviews];
    
   [self setupLayout];
    
    
}


- (void)setupUI{
    
    //添加一个label
    UILabel *infoLabel = [[UILabel alloc]init];
    
    self.infoLabel = infoLabel;
    
    [self.contentView addSubview:infoLabel];
    
    
    //添加一个uiimageView
    
    UIImageView *iconImageView = [[UIImageView alloc]init];
    
    self.iconImageView = iconImageView;
    
   // self.iconImageView.backgroundColor = [UIColor greenColor];
    
    self.iconImageView.image = [UIImage imageNamed:@"content_img_01"];
    
    [self.contentView addSubview:iconImageView];
    
    //添加一个箭头
    
    UIImageView *arrowImageView = [[UIImageView alloc]init];
    
    self.arrowImageView = arrowImageView;

   // self.arrowImageView.backgroundColor = [UIColor redColor];
    
    arrowImageView.image = [UIImage imageNamed:@"link_content"];
    
    [self.contentView addSubview:arrowImageView];
    
    //添加一个label
    
    UILabel * descLabel = [[UILabel alloc]init];
    
    self.descLabel = descLabel;
    
    descLabel.textColor = [UIColor grayColor];
    
    [self.contentView addSubview:descLabel];
    
    
}

- (void)setupLayout{
    
    [self.infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.leading.offset(kMargin);
        make.centerY.equalTo(self.contentView.mas_centerY);
        
    }];
    
    [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.trailing.equalTo(self.contentView.mas_trailing).offset(-10);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.width.offset(9);
        make.height.offset(14);
        
    }];
    
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.trailing.equalTo(self.arrowImageView.mas_leading).offset(-20);
        
        make.centerY.equalTo(self.contentView.mas_centerY);
        
        make.width.height.offset(60);
        
    }];
    
    
    [self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.trailing.equalTo(self.arrowImageView.mas_leading).offset(-10);
        make.centerY.equalTo(self.contentView.mas_centerY);
        
    }];
    
}




- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
